{template:header}
{template:usercp_menu}
<script language='javascript' type="text/javascript">
//<![CDATA[
var url_input = "{$avatarurl}";
var remove_pressed = 0;

function select_upload() {
try
{
if ( document.creator.avatarurl.value != "" ) {
url_input = document.creator.avatarurl.value;
}
document.creator.avatarurl.value = "";
}
catch(nourl)
{
return true;
}
}

function checkform()
{
if ( remove_pressed != 1 ) {
return true;
} else {
fcheck = confirm("{$lang['deletecurrentavatars']}");
if ( fcheck == true ) {
return true;
} else {
return false;
}
}
}
//]]>
</script>
<div id="ucp_content">
	<h3>{$lang['avatarsetting']}</h3>
	<p>{$lang['avatarsettingdesc']}:{$allowed_files}</p>
	<em>{$lang['currentavatar']}</em>
	<div class='ucp'>
		{$my_avatar}
	</div>
	<if="$show['gallerylist']">
	<em>{$lang['avatargallery']}</em>
	<form action='usercp.php' method='post'>
		<input type='hidden' name='do' value='getgallery' />
		<input type='hidden' name='posthash' value='{$posthash}' />
		<input type='hidden' name='s' value='{sessionid}' />
		<div class='ucp'>
			{$lang['selectedavatar']}
			{$gallerylist}
			<input type="submit" accesskey="s" value=" {$lang['_ok']} " name="submit" class="button_normal" />
		</div>
	</form>
	</if>
	<form action='usercp.php' method='post' {$formextra} name='creator' onsubmit="return checkform();">
		<input type='hidden' name='do' value='doavatar' />
		<input type='hidden' name='posthash' value='{$posthash}' />
		<input type='hidden' name='s' value='{sessionid}' />
		{$hidden_field}
		<if="$show['avatarurl'] || $show['avatar_upload']">
		<em>{$lang['uploadavatar']}</em>
		<div class='ucp'>
			<if="$show['avatarurl']">
			<p>
				{$lang['inputavatarurl']}
				<input type='text' size='40' maxlength='80' name='avatarurl' value='{$avatarurl}' class='input_normal' />
			</p>
			</if>
			<if="$show['avatar_upload']">
			<p>
				{$lang['uploadlocalavatar']}
				<input type='file' size='34' name='upload_avatar' onfocus='select_upload()' onclick='select_upload()'  class='input_big' />
			</p>
			</if>
			<p class="desc">{$upload_size}</p>
		</div>
		</if>
		<div class="ucp item_change">
		  <input type="submit" name="submit" value=" {$lang['updateavatar']} " class="input_big" />
		  <input type="submit" name="remove" onclick="remove_pressed=1;" value=" {$lang['deleteavatar']} " class="input_big" />
		</div>
	</form>
</div>
{template:footer}